﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Utils;
using System.ComponentModel;
using System.Drawing;
using System.ComponentModel.Design;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.Utils.Design;
using System.Reflection;
using System.Drawing.Design;
using System.Windows.Forms.Design;

namespace ProgNetComponentsDx.Base.Components
{
    [Designer(typeof(CommonImageCollectionDesigner))]
    public abstract class CommonImageCollection : ImageCollection, ISupportInitialize
    {
        [Browsable(false)]
        public CommonImageCollection Self
        {
            get { return this; }
        }

        private int _FormIconIndex = -1;
        protected Images _Additional;
        protected int DefImagesCount = 0;
        protected CommonImageCollection _OtherImageCollection;
        protected ImageCollection col = new ImageCollection();


        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), NotifyParentProperty(true), RefreshProperties(System.ComponentModel.RefreshProperties.All)]
        public CommonImageCollection OtherImageCollection
        {
            get { return _OtherImageCollection; }
            set
            {
                CommonImageCollection c = value;
                while (c != null)
                {
                    if (c == this)
                        throw new Exception("ImageCollection Loop Detected.");
                    c = c.OtherImageCollection;
                }
                if (value != null)
                    value.ImageSize = this.ImageSize;
                _OtherImageCollection = value;
                ReAddAdditionalImages();
            }
        }
        private void _AddDefImages()
        {
            AddDefImages();
            DefImagesCount = Images.Count;
        }
        public CommonImageCollection()
            : base(false)
        {
            _Additional = new DevExpress.Utils.Images(col);
            col.ImageSize = new Size(48, 48);
            _AddDefImages();
            DefImagesCount = Images.Count;
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), ReadOnly(true)]
        public new Images Images
        {
            get
            {
                return base.Images;
            }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content), NotifyParentProperty(true), RefreshProperties(System.ComponentModel.RefreshProperties.All)]
        public Images AdditionalImages
        {
            get { return _Additional; }
        }

        internal void ReAddAdditionalImages()
        {
            if (Images != null)
            {
                while (Images.Count > DefImagesCount)
                    Images.RemoveAt(DefImagesCount);
                Images.AddRange(AdditionalImages);
                if (OtherImageCollection != null)
                {
                    Image[] arr = new Image[OtherImageCollection.Images.Count];
                    OtherImageCollection.Images.CopyTo(arr, 0);
                    Images.AddRange(arr);
                }
            }
        }

        void ISupportInitialize.EndInit()
        {
            base.EndInit();
            ReAddAdditionalImages();
            SetFormsIcon();
        }

        public new Size ImageSize
        {
            get { return base.ImageSize; }
            set
            {
                col.ImageSize = value;
                base.ImageSize = value;

                if (Images.Count == 0)
                    _AddDefImages();
                ReAddAdditionalImages();
            }
        }

        [Browsable(false)]
        public new ImageCollectionStreamer ImageStream
        {
            get { return null; }
            set { }
        }

        protected abstract void AddDefImages();

        public void AddImages(params Image[] images)
        {
            if (images != null)
                foreach (Image i in images)
                    AddImage(i);
        }

        [Browsable(false)]
        public int FormIconIndex
        {
            get { return _FormIconIndex; }
            set
            {
                _FormIconIndex = value;
                if (value < 0 || value > Images.Count - 1)
                    return;
                SetFormsIcon();
            }
        }

        [Browsable(false)]
        public Form OwnerForm
        {
            get;
            set;
        }

        private void SetFormsIcon()
        {
            Icon icon = null;
            if (FormIconIndex > -1 && FormIconIndex < Images.Count - 1)
                icon = Images[FormIconIndex].AsIcon();

            if (icon == null)
                return;

            if (this.IsDesignMode())
            {
                IDesignerHost host = this.GetService<IDesignerHost>();
                IComponentChangeService change = this.GetService<IComponentChangeService>();

                if (host != null)
                {
                    if (host.RootComponent is Form)
                    {
                        this.OwnerForm = host.RootComponent as Form;
                        if (OwnerForm != null)
                        {
                            DesignerTransaction tr = host.CreateTransaction();
                            try
                            {
                                System.Reflection.FieldInfo fi = typeof(System.Windows.Forms.Form).GetField("defaultIcon", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
                                if (fi != null)
                                {
                                    OwnerForm.Icon = fi.GetValue(null) as Icon;
                                }
                                MemberDescriptor md = TypeDescriptor.GetProperties(host.RootComponent)["Icon"];
                                if (change != null && md != null)
                                {
                                    change.OnComponentChanged(host.RootComponent, md, OwnerForm.Icon, null);
                                    change.OnComponentChanged(host.RootComponent, md, OwnerForm.Icon, icon);
                                }
                            }
                            catch { }
                            tr.Commit();
                        }
                    }
                }
            }
            if (OwnerForm != null && icon != null)
            {
                OwnerForm.Icon = icon;
            }
        }
    }
    public class MyImageIndexesEditor : ObjectPickerEditor
    {
        internal IWindowsFormsEditorService edSvc;
        internal ITypeDescriptorContext thecontext;
        protected object GetImageListInfo(ITypeDescriptorContext context)
        {
            object obj1 = (object)null;
            foreach (object obj2 in context.PropertyDescriptor.Attributes)
            {
                if (obj2 is ImageListAttribute)
                {
                    string name = (obj2 as ImageListAttribute).Name;
                    object instance = DXObjectWrapper.GetInstance(context);
                    PropertyInfo property = instance.GetType().GetProperty(name);
                    if (property != null)
                    {
                        obj1 = property.GetValue(instance, (object[])null);
                        break;
                    }
                    else
                        break;
                }
            }
            return obj1;
        }

        protected override bool CanEditValue(ITypeDescriptorContext context, IServiceProvider provider)
        {
            this.edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            if (context != null)
                thecontext = context;
            if (base.CanEditValue(context, provider))
                return this.GetImageListInfo(context) != null;
            else
                return false;
        }

        protected override ObjectPickerControl CreateObjectPickerControl(ITypeDescriptorContext context, object value)
        {
            if (context != null)
                thecontext = context;
            return (ObjectPickerControl)new MyImageIndexesEditorForm(this, this.GetImageListInfo(context), value);
        }
        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            if (context != null)
                thecontext = context;

            return base.GetEditStyle(context);
        }
        
        public override void PaintValue(PaintValueEventArgs e)
        {
            if (e.Context != null)
                thecontext = e.Context;
            if (thecontext != null)
            {
                object imageListInfo = this.GetImageListInfo(thecontext);
                Rectangle bounds1 = e.Bounds;
                --bounds1.Width;
                --bounds1.Height;
                e.Graphics.DrawRectangle(SystemPens.ControlText, bounds1);
                Rectangle bounds2 = e.Bounds;
                bounds2.Inflate(-1, -1);
                int index = e.Value == null ? -1 : (int)e.Value;
                e.Graphics.FillRectangle(SystemBrushes.Window, bounds2);
                Image imageListImage = ImageCollection.GetImageListImage(imageListInfo, index);
                if (imageListImage != null)
                {
                    e.Graphics.FillRectangle(SystemBrushes.Window, bounds2);
                    e.Graphics.DrawImage(imageListImage, bounds2);
                }
            }
        }

        public override bool GetPaintValueSupported(ITypeDescriptorContext context)
        {
            if (ObjectPickerEditor.IsContextInvalid(context))
                return true;
            else
                return base.GetPaintValueSupported();
        }

        private void SaveChanges(object sender, EventArgs e, bool bNeedSave)
        {
            this.edSvc.CloseDropDown();
        }
    }
    internal class MyImageIndexesEditorForm : ObjectPickerControl
    {
        protected object imageList;

        protected override bool SupportCustomDrawItem
        {
            get
            {
                return true;
            }
        }

        public object ImageList
        {
            get
            {
                return this.imageList;
            }
        }

        public MyImageIndexesEditorForm(MyImageIndexesEditor editor, object imageList, object editValue)
            : base((ObjectPickerEditor)editor, editValue)
        {
            this.imageList = imageList;
        }

        private Size GetImageListSize()
        {
            Size imageListSize = DevExpress.Utils.ImageCollection.GetImageListSize(this.ImageList);
            if (imageListSize.Height > 32)
            {
                float num = (float)imageListSize.Height / 32f;
                imageListSize.Height = (int)((double)imageListSize.Height / (double)num);
                imageListSize.Width = (int)((double)imageListSize.Width / (double)num);
                if (imageListSize.Width < 0)
                    imageListSize.Width = DevExpress.Utils.ImageCollection.GetImageListSize(this.ImageList).Width;
            }
            return imageListSize;
        }

        protected override void CustomDrawItem(DrawItemEventArgs e)
        {
            int num = (int)this.listBox.Items[e.Index];
            string itemText = num >= 0 ? num.ToString() : "none";
            Size imageListSize = this.GetImageListSize();
            ObjectPickerControl.DrawImageItemText(e, itemText, imageListSize);
            if (DevExpress.Utils.ImageCollection.IsImageListImageExists(this.ImageList, num))
            {
                ObjectPickerControl.DrawImageItemImage(e, this.ImageList, num, imageListSize);
            }
            else
            {
                using (Pen pen = (Pen)Pens.Red.Clone())
                {
                    pen.Width = 2f;
                    e.Graphics.DrawLine(pen, e.Bounds.X, e.Bounds.Y, e.Bounds.X + imageListSize.Width, e.Bounds.Y + imageListSize.Height);
                    e.Graphics.DrawLine(pen, e.Bounds.X + imageListSize.Width, e.Bounds.Y, e.Bounds.X, e.Bounds.Y + imageListSize.Height);
                }
            }
        }

        public override void Initialize()
        {
            this.listBox.ItemHeight = this.GetImageListSize().Height + 2;
            for (int index = -1; index < DevExpress.Utils.ImageCollection.GetImageListImageCount(this.ImageList); ++index)
                this.listBox.Items.Add((object)index);
            int num = this.EditValue == null ? -1 : (int)this.EditValue;
            if (num + 1 < this.listBox.Items.Count && num > -1)
                this.listBox.SelectedIndex = num + 1;
            base.Initialize();
        }
    }
    public class CommonImageCollectionDesigner : System.ComponentModel.Design.ComponentDesigner
    {
        public override System.ComponentModel.Design.DesignerActionListCollection ActionLists
        {
            get
            {
                DesignerActionListCollection l = new DesignerActionListCollection();
                l.Add(new CommonImageCollectionActionList(this, this.Component));
                return l;
            }
        }

        public override DesignerVerbCollection Verbs
        {
            get
            {
                DesignerVerbCollection verbs = new DesignerVerbCollection();
                verbs.Add(new DesignerVerb("Update Images", new EventHandler(UpdateImages)));
                return verbs;
            }
        }

        private void UpdateImages(object sender, EventArgs e)
        {
            CommonImageCollection img = Component as CommonImageCollection;
            if (img != null)
                img.ReAddAdditionalImages();
        }
    }
    public class CommonImageCollectionActionList : DesignerActionList
    {
        protected DesignerActionItemCollection list = new DesignerActionItemCollection();
        protected IDesigner _Designer;
        protected object _Owner;
        protected string _PropertyName;
        public CommonImageCollection Collection
        {
            get { return _Owner as CommonImageCollection; }
        }

        public CommonImageCollectionActionList(IDesigner designer, object owner)
            : base(designer.Component)
        {
            _Designer = designer;
            _Owner = owner;

            list.Add(new DesignerActionHeaderItem("Form's Icon", "Form's Icon"));
            list.Add(new DesignerActionPropertyItem("FormIconIndex", "Form's icon index", "Form's Icon"));
            list.Add(new DesignerActionTextItem("Form's icon can look different at design time", "Form's Icon"));

            list.Add(new DesignerActionHeaderItem("Additional Images", "Additional Images"));
            list.Add(new DesignerActionMethodItem(this, "UpdateImages", "Update Images", "Additional Images"));
        }

        [Editor(typeof(MyImageIndexesEditor), typeof(UITypeEditor))]
        [ImageList("Collection")]
        public int FormIconIndex
        {
            get
            {
                if (Collection != null)
                    return Collection.FormIconIndex;
                return -1;
            }
            set
            {
                if (Collection != null)
                    Collection.FormIconIndex = value;
            }
        }

        public void UpdateImages()
        {
            try
            {
                if (Collection != null)
                {
                    Collection.ReAddAdditionalImages();
                }
            }
            catch
            {

            }
        }

        public override DesignerActionItemCollection GetSortedActionItems()
        {
            return list;
        }
    }

    public class CommonImageCollectionOther : CommonImageCollection
    {
        protected override void AddDefImages()
        {
            AddImage(Properties.Resources.credit_cards_48x48);
            AddImage(Properties.Resources.hd_locked_48x48);
            AddImage(Properties.Resources.help_48x48);
            AddImage(Properties.Resources.income_48x48);
            AddImage(Properties.Resources.key_48x48);
            AddImage(Properties.Resources.money_48x48);
            AddImage(Properties.Resources.yen_coins_48x48);
            AddImage(Properties.Resources.key_f16);
            AddImage(Properties.Resources.key_i16);
            AddImage(Properties.Resources.key_u16);
        }
    }
    public class CommonImageCollectionFull : CommonImageCollection
    {
        protected override void AddDefImages()
        {
            AddImage(Properties.Resources.accept);
            AddImage(Properties.Resources.add);
            AddImage(Properties.Resources.addfile);
            AddImage(Properties.Resources.adduser);
            AddImage(Properties.Resources.app);
            AddImage(Properties.Resources.back);
            AddImage(Properties.Resources.backward);
            AddImage(Properties.Resources.bug);
            AddImage(Properties.Resources.burn);
            AddImage(Properties.Resources.cd);
            AddImage(Properties.Resources.chat);
            AddImage(Properties.Resources.clock);
            AddImage(Properties.Resources.close);
            AddImage(Properties.Resources.configure);
            AddImage(Properties.Resources.console);
            AddImage(Properties.Resources.cut);
            AddImage(Properties.Resources.cutb);
            AddImage(Properties.Resources.database);
            AddImage(Properties.Resources.delete);
            AddImage(Properties.Resources.deletefile);
            AddImage(Properties.Resources.deleteuser);
            AddImage(Properties.Resources.documentsorcopy);
            AddImage(Properties.Resources.down);
            AddImage(Properties.Resources.edit);
            AddImage(Properties.Resources.fav);
            AddImage(Properties.Resources.favadd);
            AddImage(Properties.Resources.favb);
            AddImage(Properties.Resources.favbadd);
            AddImage(Properties.Resources.file);
            AddImage(Properties.Resources.filelocked);
            AddImage(Properties.Resources.filesearch);
            AddImage(Properties.Resources.find);
            AddImage(Properties.Resources.floppy);
            AddImage(Properties.Resources.folder);
            AddImage(Properties.Resources.folderlocked);
            AddImage(Properties.Resources.foldermove);
            AddImage(Properties.Resources.folderopenb);
            AddImage(Properties.Resources.foldersearch);
            AddImage(Properties.Resources.forward);
            AddImage(Properties.Resources.gotoapp);
            AddImage(Properties.Resources.gowebsite);
            AddImage(Properties.Resources.groupofusers);
            AddImage(Properties.Resources.hd);
            AddImage(Properties.Resources.hdlocked);
            AddImage(Properties.Resources.hdsearch);
            AddImage(Properties.Resources.help);
            AddImage(Properties.Resources.home);
            AddImage(Properties.Resources.infoabout);
            AddImage(Properties.Resources.key);
            AddImage(Properties.Resources._lock);
            AddImage(Properties.Resources.mail);
            AddImage(Properties.Resources.mailpgp);
            AddImage(Properties.Resources.mailsend);
            AddImage(Properties.Resources.money);
            AddImage(Properties.Resources.moneyb);
            AddImage(Properties.Resources.moneyc);
            AddImage(Properties.Resources.movefile);
            AddImage(Properties.Resources.music);
            AddImage(Properties.Resources.network);
            AddImage(Properties.Resources.networkoptions);
            AddImage(Properties.Resources.networksearch);
            AddImage(Properties.Resources.next);
            AddImage(Properties.Resources.paint);
            AddImage(Properties.Resources.pastfile);
            AddImage(Properties.Resources.pause);
            AddImage(Properties.Resources.pictures);
            AddImage(Properties.Resources.play);
            AddImage(Properties.Resources.printer);
            AddImage(Properties.Resources.printpreview);
            AddImage(Properties.Resources.redo);
            AddImage(Properties.Resources.refresh);
            AddImage(Properties.Resources.saveas);
            AddImage(Properties.Resources.stats);
            AddImage(Properties.Resources.stop);
            AddImage(Properties.Resources.textfile);
            AddImage(Properties.Resources.trash);
            AddImage(Properties.Resources.trashb);
            AddImage(Properties.Resources.undo);
            AddImage(Properties.Resources.up);
            AddImage(Properties.Resources.user);
            AddImage(Properties.Resources.userb);
            AddImage(Properties.Resources.userid);
            AddImage(Properties.Resources.userlock);
            AddImage(Properties.Resources.web);
            AddImage(Properties.Resources.webhd);
            AddImage(Properties.Resources.weblocked);
            AddImage(Properties.Resources.weboptions);
            AddImage(Properties.Resources.websearch);
            AddImage(Properties.Resources.window);
            AddImage(Properties.Resources.windowb);
            AddImage(Properties.Resources.wizard);
            AddImage(Properties.Resources.zoomin);
            AddImage(Properties.Resources.zoomout);
        }
    }
    public class CommonImageCollection16 : CommonImageCollection
    {
        protected override void AddDefImages()
        {
            AddImage(Properties.Resources.accept16);
            AddImage(Properties.Resources.add16);
            AddImage(Properties.Resources.addfile16);
            AddImage(Properties.Resources.adduser16);
            AddImage(Properties.Resources.app16);
            AddImage(Properties.Resources.back16);
            AddImage(Properties.Resources.backward16);
            AddImage(Properties.Resources.bug16);
            AddImage(Properties.Resources.burn16);
            AddImage(Properties.Resources.cd16);
            AddImage(Properties.Resources.chat16);
            AddImage(Properties.Resources.clock16);
            AddImage(Properties.Resources.close16);
            AddImage(Properties.Resources.configure16);
            AddImage(Properties.Resources.console16);
            AddImage(Properties.Resources.cut16);
            AddImage(Properties.Resources.cutb16);
            AddImage(Properties.Resources.database16);
            AddImage(Properties.Resources.delete16);
            AddImage(Properties.Resources.deletefile16);
            AddImage(Properties.Resources.deleteuser16);
            AddImage(Properties.Resources.documentsorcopy16);
            AddImage(Properties.Resources.down16);
            AddImage(Properties.Resources.edit16);
            AddImage(Properties.Resources.fav16);
            AddImage(Properties.Resources.favadd16);
            AddImage(Properties.Resources.favb16);
            AddImage(Properties.Resources.favbadd16);
            AddImage(Properties.Resources.file16);
            AddImage(Properties.Resources.filelocked16);
            AddImage(Properties.Resources.filesearch16);
            AddImage(Properties.Resources.find16);
            AddImage(Properties.Resources.floppy16);
            AddImage(Properties.Resources.folder16);
            AddImage(Properties.Resources.folderlocked16);
            AddImage(Properties.Resources.foldermove16);
            AddImage(Properties.Resources.folderopenb16);
            AddImage(Properties.Resources.foldersearch16);
            AddImage(Properties.Resources.forward16);
            AddImage(Properties.Resources.gotoapp16);
            AddImage(Properties.Resources.gowebsite16);
            AddImage(Properties.Resources.groupofusers16);
            AddImage(Properties.Resources.hd16);
            AddImage(Properties.Resources.hdlocked16);
            AddImage(Properties.Resources.hdsearch16);
            AddImage(Properties.Resources.help16);
            AddImage(Properties.Resources.home16);
            AddImage(Properties.Resources.infoabout16);
            AddImage(Properties.Resources.key16);
            AddImage(Properties.Resources.lock16);
            AddImage(Properties.Resources.mail16);
            AddImage(Properties.Resources.mailpgp16);
            AddImage(Properties.Resources.mailsend16);
            AddImage(Properties.Resources.money16);
            AddImage(Properties.Resources.moneyb16);
            AddImage(Properties.Resources.moneyc16);
            AddImage(Properties.Resources.movefile16);
            AddImage(Properties.Resources.music16);
            AddImage(Properties.Resources.network16);
            AddImage(Properties.Resources.networkoptions16);
            AddImage(Properties.Resources.networksearch16);
            AddImage(Properties.Resources.next16);
            AddImage(Properties.Resources.paint16);
            AddImage(Properties.Resources.pastfile16);
            AddImage(Properties.Resources.pause16);
            AddImage(Properties.Resources.pictures16);
            AddImage(Properties.Resources.play16);
            AddImage(Properties.Resources.printer16);
            AddImage(Properties.Resources.printpreview16);
            AddImage(Properties.Resources.redo16);
            AddImage(Properties.Resources.refresh16);
            AddImage(Properties.Resources.saveas16);
            AddImage(Properties.Resources.stats16);
            AddImage(Properties.Resources.stop16);
            AddImage(Properties.Resources.textfile16);
            AddImage(Properties.Resources.trash16);
            AddImage(Properties.Resources.trashb16);
            AddImage(Properties.Resources.undo16);
            AddImage(Properties.Resources.up16);
            AddImage(Properties.Resources.user16);
            AddImage(Properties.Resources.userb16);
            AddImage(Properties.Resources.userid16);
            AddImage(Properties.Resources.userlock16);
            AddImage(Properties.Resources.web16);
            AddImage(Properties.Resources.webhd16);
            AddImage(Properties.Resources.weblocked16);
            AddImage(Properties.Resources.weboptions16);
            AddImage(Properties.Resources.websearch16);
            AddImage(Properties.Resources.window16);
            AddImage(Properties.Resources.windowb16);
            AddImage(Properties.Resources.wizard16);
            AddImage(Properties.Resources.zoomin16);
            AddImage(Properties.Resources.zoomout16);
        }
    }
    public class CommonImageCollection32 : CommonImageCollection
    {
        protected override void AddDefImages()
        {
            AddImage(Properties.Resources.accept32);
            AddImage(Properties.Resources.add32);
            AddImage(Properties.Resources.addfile32);
            AddImage(Properties.Resources.adduser32);
            AddImage(Properties.Resources.app32);
            AddImage(Properties.Resources.back32);
            AddImage(Properties.Resources.backward32);
            AddImage(Properties.Resources.bug32);
            AddImage(Properties.Resources.burn32);
            AddImage(Properties.Resources.cd32);
            AddImage(Properties.Resources.chat32);
            AddImage(Properties.Resources.clock32);
            AddImage(Properties.Resources.close32);
            AddImage(Properties.Resources.configure32);
            AddImage(Properties.Resources.console32);
            AddImage(Properties.Resources.cut32);
            AddImage(Properties.Resources.cutb32);
            AddImage(Properties.Resources.database32);
            AddImage(Properties.Resources.delete32);
            AddImage(Properties.Resources.deletefile32);
            AddImage(Properties.Resources.deleteuser32);
            AddImage(Properties.Resources.documentsorcopy32);
            AddImage(Properties.Resources.down32);
            AddImage(Properties.Resources.edit32);
            AddImage(Properties.Resources.fav32);
            AddImage(Properties.Resources.favadd32);
            AddImage(Properties.Resources.favb32);
            AddImage(Properties.Resources.favbadd32);
            AddImage(Properties.Resources.file32);
            AddImage(Properties.Resources.filelocked32);
            AddImage(Properties.Resources.filesearch32);
            AddImage(Properties.Resources.find32);
            AddImage(Properties.Resources.floppy32);
            AddImage(Properties.Resources.folder32);
            AddImage(Properties.Resources.folderlocked32);
            AddImage(Properties.Resources.foldermove32);
            AddImage(Properties.Resources.folderopenb32);
            AddImage(Properties.Resources.foldersearch32);
            AddImage(Properties.Resources.forward32);
            AddImage(Properties.Resources.gotoapp32);
            AddImage(Properties.Resources.gowebsite32);
            AddImage(Properties.Resources.groupofusers32);
            AddImage(Properties.Resources.hd32);
            AddImage(Properties.Resources.hdlocked32);
            AddImage(Properties.Resources.hdsearch32);
            AddImage(Properties.Resources.help32);
            AddImage(Properties.Resources.home32);
            AddImage(Properties.Resources.infoabout32);
            AddImage(Properties.Resources.key32);
            AddImage(Properties.Resources.lock32);
            AddImage(Properties.Resources.mail32);
            AddImage(Properties.Resources.mailpgp32);
            AddImage(Properties.Resources.mailsend32);
            AddImage(Properties.Resources.money32);
            AddImage(Properties.Resources.moneyb32);
            AddImage(Properties.Resources.moneyc32);
            AddImage(Properties.Resources.movefile32);
            AddImage(Properties.Resources.music32);
            AddImage(Properties.Resources.network32);
            AddImage(Properties.Resources.networkoptions32);
            AddImage(Properties.Resources.networksearch32);
            AddImage(Properties.Resources.next32);
            AddImage(Properties.Resources.paint32);
            AddImage(Properties.Resources.pastfile32);
            AddImage(Properties.Resources.pause32);
            AddImage(Properties.Resources.pictures32);
            AddImage(Properties.Resources.play32);
            AddImage(Properties.Resources.printer32);
            AddImage(Properties.Resources.printpreview32);
            AddImage(Properties.Resources.redo32);
            AddImage(Properties.Resources.refresh32);
            AddImage(Properties.Resources.saveas32);
            AddImage(Properties.Resources.stats32);
            AddImage(Properties.Resources.stop32);
            AddImage(Properties.Resources.textfile32);
            AddImage(Properties.Resources.trash32);
            AddImage(Properties.Resources.trashb32);
            AddImage(Properties.Resources.undo32);
            AddImage(Properties.Resources.up32);
            AddImage(Properties.Resources.user32);
            AddImage(Properties.Resources.userb32);
            AddImage(Properties.Resources.userid32);
            AddImage(Properties.Resources.userlock32);
            AddImage(Properties.Resources.web32);
            AddImage(Properties.Resources.webhd32);
            AddImage(Properties.Resources.weblocked32);
            AddImage(Properties.Resources.weboptions32);
            AddImage(Properties.Resources.websearch32);
            AddImage(Properties.Resources.window32);
            AddImage(Properties.Resources.windowb32);
            AddImage(Properties.Resources.wizard32);
            AddImage(Properties.Resources.zoomin32);
            AddImage(Properties.Resources.zoomout32);

        }
    }
    public class CommonImageCollection24 : CommonImageCollection
    {
        protected override void AddDefImages()
        {
            AddImage(Properties.Resources.accept24);
            AddImage(Properties.Resources.add24);
            AddImage(Properties.Resources.addfile24);
            AddImage(Properties.Resources.adduser24);
            AddImage(Properties.Resources.app24);
            AddImage(Properties.Resources.back24);
            AddImage(Properties.Resources.backward24);
            AddImage(Properties.Resources.bug24);
            AddImage(Properties.Resources.burn24);
            AddImage(Properties.Resources.cd24);
            AddImage(Properties.Resources.chat24);
            AddImage(Properties.Resources.clock24);
            AddImage(Properties.Resources.close24);
            AddImage(Properties.Resources.configure24);
            AddImage(Properties.Resources.console24);
            AddImage(Properties.Resources.cut24);
            AddImage(Properties.Resources.cutb24);
            AddImage(Properties.Resources.database24);
            AddImage(Properties.Resources.delete24);
            AddImage(Properties.Resources.deletefile24);
            AddImage(Properties.Resources.deleteuser24);
            AddImage(Properties.Resources.documentsorcopy24);
            AddImage(Properties.Resources.down24);
            AddImage(Properties.Resources.edit24);
            AddImage(Properties.Resources.fav24);
            AddImage(Properties.Resources.favadd24);
            AddImage(Properties.Resources.favb24);
            AddImage(Properties.Resources.favbadd24);
            AddImage(Properties.Resources.file24);
            AddImage(Properties.Resources.filelocked24);
            AddImage(Properties.Resources.filesearch24);
            AddImage(Properties.Resources.find24);
            AddImage(Properties.Resources.floppy24);
            AddImage(Properties.Resources.folder24);
            AddImage(Properties.Resources.folderlocked24);
            AddImage(Properties.Resources.foldermove24);
            AddImage(Properties.Resources.folderopenb24);
            AddImage(Properties.Resources.foldersearch24);
            AddImage(Properties.Resources.forward24);
            AddImage(Properties.Resources.gotoapp24);
            AddImage(Properties.Resources.gowebsite24);
            AddImage(Properties.Resources.groupofusers24);
            AddImage(Properties.Resources.hd24);
            AddImage(Properties.Resources.hdlocked24);
            AddImage(Properties.Resources.hdsearch24);
            AddImage(Properties.Resources.help24);
            AddImage(Properties.Resources.home24);
            AddImage(Properties.Resources.infoabout24);
            AddImage(Properties.Resources.key24);
            AddImage(Properties.Resources.lock24);
            AddImage(Properties.Resources.mail24);
            AddImage(Properties.Resources.mailpgp24);
            AddImage(Properties.Resources.mailsend24);
            AddImage(Properties.Resources.money24);
            AddImage(Properties.Resources.moneyb24);
            AddImage(Properties.Resources.moneyc24);
            AddImage(Properties.Resources.movefile24);
            AddImage(Properties.Resources.music24);
            AddImage(Properties.Resources.network24);
            AddImage(Properties.Resources.networkoptions24);
            AddImage(Properties.Resources.networksearch24);
            AddImage(Properties.Resources.next24);
            AddImage(Properties.Resources.paint24);
            AddImage(Properties.Resources.pastfile24);
            AddImage(Properties.Resources.pause24);
            AddImage(Properties.Resources.pictures24);
            AddImage(Properties.Resources.play24);
            AddImage(Properties.Resources.printer24);
            AddImage(Properties.Resources.printpreview24);
            AddImage(Properties.Resources.redo24);
            AddImage(Properties.Resources.refresh24);
            AddImage(Properties.Resources.saveas24);
            AddImage(Properties.Resources.stats24);
            AddImage(Properties.Resources.stop24);
            AddImage(Properties.Resources.textfile24);
            AddImage(Properties.Resources.trash24);
            AddImage(Properties.Resources.trashb24);
            AddImage(Properties.Resources.undo24);
            AddImage(Properties.Resources.up24);
            AddImage(Properties.Resources.user24);
            AddImage(Properties.Resources.userb24);
            AddImage(Properties.Resources.userid24);
            AddImage(Properties.Resources.userlock24);
            AddImage(Properties.Resources.web24);
            AddImage(Properties.Resources.webhd24);
            AddImage(Properties.Resources.weblocked24);
            AddImage(Properties.Resources.weboptions24);
            AddImage(Properties.Resources.websearch24);
            AddImage(Properties.Resources.window24);
            AddImage(Properties.Resources.windowb24);
            AddImage(Properties.Resources.wizard24);
            AddImage(Properties.Resources.zoomin24);
            AddImage(Properties.Resources.zoomout24);
        }
    }
}
